//
//  MyBalanceListCell.swift
//  XiaoJingMallSwift
//
//  Created by beisheng03 on 2017/9/6.
//  Copyright © 2017年 beisheng. All rights reserved.
//

import UIKit

class MyBalanceListCell: BaseTableViewCell {
    

    @IBOutlet weak var leftTopLabel: UILabel!
    
    @IBOutlet weak var leftBottomLabel: UILabel!
    
    @IBOutlet weak var rightTopLabel: UILabel!
    
    @IBOutlet weak var rightBottomLabel: UILabel!
    var model : GoldBeanListModel?{
        
        didSet{
            
            if model == nil {
                return
            }
            
            let number = Float(model!.lg_av_amount) ?? 0
            
            if number > 0 {
                
                rightTopLabel.text =  "+\(number)"
                
            } else {
                
                rightTopLabel.text = model?.lg_av_amount

            }
            
            leftTopLabel.text = model?.lg_desc
            
            leftBottomLabel.text = model?.lg_add_time
            
            if let temp = model?.lg_balance {
                rightBottomLabel.text = "余额: " + temp
            }

            
        }
    
    }

    override func awakeFromNib() {
        super.awakeFromNib()
        contentView.backgroundColor = UIColor.white
        rightTopLabel.textColor = UIColor.orange
        leftBottomLabel.textColor = UIColor.dakGray()
        rightBottomLabel.textColor = UIColor.dakGray()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
